﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using QuanLiBongDa.DataAccessLayer;
using QuanLiBongDa.BusinessLogicLayer;
namespace QuanLiBongDa.PresentationLayer
{
    public partial class TraCuu : UserControl
    {
        public TraCuu()
        {
            InitializeComponent();
        }
        TraCuuCauThuBLO blo = new TraCuuCauThuBLO();
        //public void LoadTraCuu()
        //{
        //    dataGridView1.DataSource = blo.LoadTCCT("LoadTCCT");
        //}
        public void LoadTenCT()
        {
            blo.MaCT(cbb_ChonCT);
        }

        private void bt_TraCuu_Click(object sender, EventArgs e)
        {
            string s = "";
            string str = "";
            if (cbb_ChonCT.SelectedItem == null)
                MessageBox.Show("Bạn chưa chọn cầu thủ");
            else
            {
                s = cbb_ChonCT.SelectedItem.ToString();
                DataTable dt = blo.TimMCT_Ten(s);
                str = dt.Rows[0][0].ToString();
            }
            dataGridView1.DataSource = blo.TraCuuCauThu(str);
        }

        private void TraCuu_Load(object sender, EventArgs e)
        {
            this.LoadTenCT();
        }
    }
}
